Trilium can connect to a large language model and use it as an assistant that works directly on your notes: ask questions about the note you're reading, have it draft or restructure content, or get it to write scripts and widgets for you.

The integration is off by default and does nothing until you enable it and configure a provider; Trilium ships no model of its own. The provider you pick decides how your notes travel: a cloud API billed per use, a subscription you already pay for, or a model running on your own hardware, in which case nothing leaves the machine. See Providers for what each involves, and Privacy for exactly what gets sent.

Once enabled, the assistant is available as:

Feature highlights

Sample use-cases

LLM Providers

Trilium supports four different types of providers:

For more information about each provider, see Providers. See the dedicated Privacy to better understand what data is sent to providers.

Enabling the AI integration

To enable the AI integration, simply go to Options → AI / LLM and press the toggle in the top-right of the dialog and configure a provider.

Creating a new chat

There are two different chat interfaces:

The sidebar interface

The dedicated note type

The dedicated chat note is similar to the sidebar interface, but it makes longer conversations more comfortable to read.

Unlike the sidebar, the AI will not be aware of the current note it's in.

Templates

Chat notes can be set as Templates to make them easily reusable. The entire conversation history is kept, allowing a basic form of specialization for the LLM with the existing chat acting like a system prompt. 

Model selection

When a provider is configured in Options, the next step is to select the models that will be available for the chat.

The models are retrieved dynamically from the provider, only when the model selection list is visible. To alter the list of models, simply press the Edit button in the model selection box.

Pricing information is displayed for known models. The pricing information (price per million tokens) is embedded in the application (using a subset of LiteLLM's data) and is updated with new versions of Trilium. Local providers are considered free, whereas custom endpoint providers don't offer any pricing information.

Features

Web search

The AI can optionally search the web to find more information about a specific topic. 

Where the search comes from is chosen under Web search in the Tools menu next to the model selector at the bottom of the chat:

To use SearXNG, enable its JSON output by adding json to the search formats in the instance's settings.yml. SearXNG turns JSON off by default, and without it every search fails.

search:
  formats:
    - html
    - json

SearXNG doesn't use API keys, so leave the API key empty. Fill it in only if your instance sits behind a proxy that requires a token; Trilium sends it as a bearer token in the Authorization header.

Whether web search is on is kept per chat; the search source is shared by all chats. A choice the current model can't use stays in the menu, disabled; hover the icon next to it to see why. Claude Code, GitHub Copilot, Google Antigravity and OpenAI Codex run their own tools, so they can't use a search provider.

In the chat, a search run through a search provider shows that provider's logo at the start of its line instead of the magnifier; hover the logo to see the provider's name.

With a search provider, the model can also read the pages it finds, or a link you give it, as text: Trilium fetches the page itself and hands the model up to its first 20,000 characters. Addresses on your own machine or network are refused. In the browser version most sites don't allow being read this way, so reading a page there usually fails.

Thinking

Some models reason before they answer. While the model is thinking, its reasoning is shown in full under a spinner; once it is done, it folds into a collapsible Thought process line above the reply.

How much a model thinks is set per chat, in one of two ways depending on the model:

Note access (tools)

Tools allow the agentic AI to understand and operate on notes directly within your Trilium instance.

This feature is on by default. To turn it off, press the Tools button next to the model selector at the bottom of the chat and switch off Note access. The Tools button is highlighted while note access or web search is on.

Here are a few tools that Trilium provides for the LLM:

Each tool the AI uses appears in the chat as a single line naming the tool and the note or query it worked on; a renamed note shows its previous title struck through, a deleted note its title struck through, a moved note where it was moved from and to, an attribute the AI read, set or deleted as a pill (struck through once deleted), an attachment by its title, note and size, and a web page the AI read as a link. A line folds open only when there is something to read inline: the notes a search found, the pages a web search found, the icons an icon search found, the type, attributes or start of the content of a note the AI read, all the attributes of a note, the text of an attachment or of a web page, the User Guide pages the AI looked up or its table of contents (both open in the help panel), the children or the whole subtree of a note, what the AI wrote into a note it created, rewrote or added to, the changes of an edit, or the reason a tool failed. A search also shows how many notes it found, the part of the tree it was confined to, if any, and how many of the matches the AI asked for; each note it lists opens with a click. To see exactly what the AI sent to a tool and what it got back, hover the line and press the button next to it; on touch screens the button is always shown.

When the reply stops moving for a couple of seconds while the AI is still at work, for example while it reads what a tool returned, a Still working… line appears under it until the next part of the reply arrives.

Attachments

Since Trilium v0.140.0, Attachments allow for multi-modal chat:

Not every model reads every kind of attachment: DeepSeek reads no PDFs, and images only with its vision models; OpenAI Codex, GitHub Copilot and Google Antigravity read images but no PDFs. For such a model:

To upload an attachment:

Once one or more attachments are uploaded, they will appear directly above the text box:

Clicking an image or a PDF, either its chip above the text box or where it appears in a sent message, opens it in a viewer: an image can be zoomed and panned there, a PDF read page by page. The button next to the viewer's close button opens the original file in a new browser tab. Ctrl-clicking instead opens an image in a new browser tab, and a PDF as an attachment in a new Trilium tab.

When an attachment is present, the LLM is instructed to consider the attachment with priority, even if it has access to the current note.

Mentions

Mentions are a way to insert references to notes other than the current note, using the same mechanism as Internal (reference) links. To refer to another note, simply type @ followed by the name of the note to reference.

This feature is mostly helpful when note tools are enabled, otherwise the LLM will have no way to access the given note.

Skills

Skills in Trilium are specialized instruction sets that help the AI be more productive by understanding how Trilium.

These skills are not loaded by default to avoid an increased consumption of tokens, but the AI can load them on-demand if Note tools are enabled.

The following skills are built-in:

When Note tools are enabled the skills will automatically be made available to the AI, so no user interaction is required.

MCP

Trilium comes with a built-in MCP server which allows you to use an external agent such as Claude Code have access to your database. See the dedicated MCP page for more details.

History

Removal in v0.102.0

Starting with version v0.102.0, AI/LLM integration has been removed from the Trilium Notes core.

While a significant amount of effort went into developing this feature, maintaining and supporting it long-term proved to be unsustainable.

When upgrading to v0.102.0, your Chat notes will be preserved, but instead of the dedicated chat window they will be turned to a normal Code note, revealing the underlying JSON of the conversation.

Reintroduction in v0.103.0

Given the recent advancements of the AI scene, we decided to give the LLM integration another try. v0.103.0 introduces a completely new chat system.

One of the key changes that lead to the reimplementation is that now we are using a library (Vercel AI) to manage the inner mechanism and the differences between LLM providers instead of having to implement it on our own.